package com.yusheng.tr.multi.controller;


import com.github.pagehelper.PageInfo;
import com.yusheng.domain.R;
import com.yusheng.tr.common.log.annotation.Log;
import com.yusheng.tr.common.log.enums.BusinessType;
import com.yusheng.tr.common.core.entity.multi.ReportLogEntity;
import com.yusheng.tr.multi.service.IReportLogService;
import com.yusheng.tr.common.core.model.vo.multi.ReportLogVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 报表日志表 前端控制器
 * </p>
 *
 * @author author
 * @since 2023-10-05
 */
@RestController
@RequestMapping("/report-log")
@Tag(name = "结算单日志管理表")
public class ReportLogController {
    @Autowired
    private IReportLogService reportLogService;

    @Log(title = "查询结算单日志", businessType = BusinessType.OTHER)
    @Operation(summary = "查询结算单日志",description = "查询结算单日志")
    @Parameter(name = "reportLogEntity",description = "结算单日志参数")
    @GetMapping("/report")
    public R<List<ReportLogEntity>> queryReport(ReportLogEntity reportLogEntity) {
        List<ReportLogEntity> reportList = reportLogService.queryReport(reportLogEntity);
        return R.ok(reportList);
    }


    @GetMapping("/log")
    @Operation(summary = "分页条件查询结算单",description = "分页条件查询结算单")
    @Parameters({@Parameter(name = "pageNum",description = "当前页数"),
            @Parameter(name = "pageSize",description = "当前页数的记录数"),
            @Parameter(name = "reportLogVO",description = "分页条件")

    })
    public R<PageInfo<ReportLogEntity>> queryPage(Integer pageNum, Integer pageSize, ReportLogVO reportLogVO) {
        return R.ok(reportLogService.queryPage(pageNum, pageSize, reportLogVO));
    }
}

